﻿@code {

    [Inject, NotNull] NavigationManager? Nav { get; set; }
    [Inject, NotNull] IUIService? UI { get; set; }
    [Inject, NotNull] IAuthenticationStateProvider? StateProvider { get; set; }
    protected override async void OnInitialized()
    {
        base.OnInitialized();
        try
        {
            @*_ = MsgSrv.Error("登录过期！请重新登录！");*@
            // var redirect = Nav.ToBaseRelativePath(Nav.Uri);
            // Nav.NavigateTo($"/account/login?Redirect={HttpUtility.UrlEncode(redirect)}", true);
            await StateProvider.ClearState();
        }
        catch
        {

        }
    }

    protected override void OnAfterRender(bool firstRender)
    {
        base.OnAfterRender(firstRender);

        // @*_ = MsgSrv.Error("登录过期！请重新登录！");*@
        // var redirect = Navigator.ToBaseRelativePath(Navigator.Uri);
        // Navigator.NavigateTo($"/login?Redirect={HttpUtility.UrlEncode(redirect)}", true);
        // Navigator.NavigateTo("/login", true);
    }
}
